import { request, labelRequest } from '@/api/service'

export const urlModelPrefix = '/ai/models/'
export const urlProPrefix = '/ai/projects/'
export const urlLabelDataPrefix = '/api/projects/'

export function GetList (query) {
  return request({
    url: urlProPrefix,
    method: 'get',
    params: { ...query }
  })
}

export function AddObj (obj) {
  return request({
    url: urlModelPrefix,
    method: 'post',
    data: obj
  })
}

export function GetProObj (id) {
  return request({
    url: urlProPrefix + id + '/',
    method: 'get',
    data: { id }
  })
}

export function GetDatasets () {
  return labelRequest({
    url: urlLabelDataPrefix,
    method: 'get'
  })
}
